<template>
  <basic-container>
    <chc-crud :dataTableId="site.dataTableId"
              :option="site.option"
              :page="site.page"
              :style="{height:'60%'}"
              @current-row-change="handleCurrentRowChange">
            <!-- <template slot="username"
                      slot-scope="scope">
              <span>hello-{{scope.row.username}}</span>
            </template> -->
    </chc-crud>
    <chc-crud ref = "siteOrgTable"
              :dataTableId="siteOrg.dataTableId"
              :option="siteOrg.option"
              :page="siteOrg.page"
              :style="{height:'40%'}"
              :link-columns="siteOrgLinkColumns">
    </chc-crud>
  </basic-container>

</template>

<script>

  export default {
    name: 'site',
     data() {
      return {
        siteId:'',
        site:{
          option: {
						autoLoad: true
            //menuType: 'button'
          // column:[
          // ]
          },
          page: {
            pageSize: 20, // 每页显示多少条,
          },
          dataTableId : 'edi.site',
        },
        siteOrg:{
            option: {
            // column:[
            // ]
          },
          page: {
            pageSize: 20, // 每页显示多少条,
          },
          dataTableId : 'edi.siteOrg'
        }
      };

    },
    computed: {
      siteOrgLinkColumns(){
        return [{prop: 'siteId',
                 value: this.siteId}]
      }
    },
    methods: {
      handleCurrentRowChange(val){
        this.siteId = val.id;
      }
    }
  };
</script>
